package com.wangjialu.learner.order.controller;

import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;

/**
 * <p></p>
 *
 * @author WangJialu
 * @since 2021/6/22 13:35
 */
@RestController
@Slf4j
public class ConsumerController {

    public static final String PAYMENT_URL = "http://consul-payment-service";
    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/consumer/payment/consul")
    public String consul() {
        return restTemplate.getForObject(PAYMENT_URL + "/payment/consul", String.class);
    }

}
